<?php
$username=isset($_SESSION['username'])?$_SESSION['username']:'';
$pic=isset($_SESSION['pic'])?$_SESSION['pic']:'';
?>
<!DOCTYPE html>
<html lang="en

<head>
    <meta charset="utf-8">
<title>FACEBOW</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<!-- Le styles -->
<script type="text/javascript" src="assets/js/jquery.js"></script>
<script type="text/javascript" src="assets/js/showDt.js"></script>
<link rel="stylesheet" href="assets/css/style.css">
<link rel="stylesheet" href="assets/css/loader-style.css">
<link rel="stylesheet" href="assets/css/bootstrap.css">
<link rel="stylesheet" href="assets/css/social.css">
<link rel="stylesheet" href="assets/css/Dtbox.css">
<link rel="stylesheet" href="assets/js/upload/demos/css/uploader.css">
<link rel="stylesheet" href="assets/js/upload/demos/css/demo.css">

<!-- 表单样式 -->
<link href="assets/js/iCheck/flat/all.css" rel="stylesheet">
<link href="assets/js/iCheck/line/all.css" rel="stylesheet">

<link href="assets/js/colorPicker/bootstrap-colorpicker.css" rel="stylesheet">
<link href="assets/js/switch/bootstrap-switch.css" rel="stylesheet">
<link href="assets/js/validate/validate.css" rel="stylesheet">
<link href="assets/js/idealform/css/jquery.idealforms.css" rel="stylesheet">


<link rel="stylesheet" href="assets/js/dropZone/downloads/css/dropzone.css">
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<!-- Fav and touch icons -->
<link rel="shortcut icon" href="assets/ico/minus.png">
</head>

<body>
<i class="addDt">+</i>
<!-- Preloader -->
<div id="preloader">
    <div id="status">&nbsp;</div>
</div>
<!-- TOP NAVBAR -->
<nav role="navigation" class="navbar navbar-static-top">
    <div class="container-fluid">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
            <button data-target="#bs-example-navbar-collapse-1" data-toggle="collapse" class="navbar-toggle" type="button">
                <span class="entypo-menu"></span>
            </button>
            <button class="navbar-toggle toggle-menu-mobile toggle-left" type="button">
                <span class="entypo-list-add"></span>
            </button>




            <div id="logo-mobile" class="visible-xs">
                <h1>WEB管理<span>v1.2</span></h1>
            </div>

        </div>


        <!-- Collect the nav links, forms, and other content for toggling -->
        <div id="bs-example-navbar-collapse-1" class="collapse navbar-collapse">
            <ul class="nav navbar-nav">

                <li class="dropdown">

                    <a data-toggle="dropdown" class="dropdown-toggle" href="#"><i style="font-size:20px;" class="icon-conversation"></i><div class="noft-red">23</div></a>


                    <ul style="margin: 11px 0 0 9px;" role="menu" class="dropdown-menu dropdown-wrap">
                        <li>
                            <a href="#">
                                <img alt="" class="img-msg img-circle" src="http://api.randomuser.me/portraits/thumb/men/1.jpg">Jhon Doe <b>Just Now</b>
                            </a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a href="#">
                                <img alt="" class="img-msg img-circle" src="http://api.randomuser.me/portraits/thumb/women/1.jpg">Jeniffer <b>3 Min Ago</b>
                            </a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a href="#">
                                <img alt="" class="img-msg img-circle" src="http://api.randomuser.me/portraits/thumb/men/2.jpg">Dave <b>2 Hours Ago</b>
                            </a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a href="#">
                                <img alt="" class="img-msg img-circle" src="http://api.randomuser.me/portraits/thumb/men/3.jpg"><i>Keanu</i>  <b>1 Day Ago</b>
                            </a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a href="#">
                                <img alt="" class="img-msg img-circle" src="http://api.randomuser.me/portraits/thumb/men/4.jpg"><i>Masashi</i>  <b>2 Mounth Ago</b>
                            </a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <div>See All Messege</div>
                        </li>
                    </ul>
                </li>

                <li><a href="lock.html"><i data-toggle="tooltip" data-placement="bottom" title="Lock" style="font-size:20px;" class="icon-help tooltitle"></i></a>
                </li>

            </ul>
            <div id="nt-title-container" class="navbar-left running-text visible-lg">
                <ul class="date-top">
                    <li class="entypo-calendar" style="margin-right:5px"></li>
                    <li id="Date"></li>


                </ul>

                <ul id="digital-clock" class="digital">
                    <li class="entypo-clock" style="margin-right:5px"></li>
                    <li class="hour"></li>
                    <li>:</li>
                    <li class="min"></li>
                    <li>:</li>
                    <li class="sec"></li>
                    <li class="meridiem"></li>
                </ul>
                <ul id="nt-title">
                    <li>
                        欢迎来到facebow
                    </li>
                    <li>
                        今天天气不错啊
                    </li>
                </ul>
            </div>

            <ul style="margin-right:0;" class="nav navbar-nav navbar-right">
                <li>
                    <a data-toggle="dropdown" class="dropdown-toggle" href="#">
                        <img alt="" class="admin-pic img-circle" src="<?php echo $pic?>">Hi,<?php echo $username?> <b class="caret"></b>
                    </a>
                    <ul style="margin-top:14px;" role="menu" class="dropdown-setting dropdown-menu">
                        <li>
                            <a href="profile.html">
                                <span class="entypo-user"></span>&#160;&#160;我的主页</a>
                        </li>
                        <li>
                            <a href="#">
                                <span class="entypo-vcard"></span>&#160;&#160;修改资料</a>
                        </li>
                        <li>
                            <a href="#">
                                <span class="entypo-lifebuoy"></span>&#160;&#160;Help</a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a href="login.html">
                                <span class="entypo-basket"></span>&#160;&#160; 退出登录</a>
                        </li>
                    </ul>
                </li>
                <li>
                    <a data-toggle="dropdown" class="dropdown-toggle" href="#">
                        <span class="icon-gear"></span>&#160;&#160;背景</a>
                    <ul role="menu" class="dropdown-setting dropdown-menu">

                        <li class="theme-bg">
                            <div id="button-bg"></div>
                            <div id="button-bg2"></div>
                            <div id="button-bg3"></div>
                            <div id="button-bg5"></div>
                            <div id="button-bg6"></div>
                            <div id="button-bg7"></div>
                            <div id="button-bg8"></div>
                            <div id="button-bg9"></div>
                            <div id="button-bg10"></div>
                            <div id="button-bg11"></div>
                            <div id="button-bg12"></div>
                            <div id="button-bg13"></div>
                        </li>
                    </ul>
                </li>
                <li class="hidden-xs">
                    <a class="toggle-left" href="#">
                        <span style="font-size:20px;" class="entypo-list-add"></span>
                    </a>
                </li>
            </ul>

        </div>
        <!-- /.navbar-collapse -->
    </div>
    <!-- /.container-fluid -->
</nav>

<!-- /END OF TOP NAVBAR -->

<!-- SIDE MENU -->
<div id="skin-select">
    <div id="logo">
        <h1>FaceBow<span>v1.0</span></h1>
    </div>

    <a id="toggle">
        <span class="entypo-menu"></span>
    </a>
    <div class="dark">
        <form action="#">
                <span>
                    <input type="text" name="search" value="" class="search rounded id_search" placeholder="搜索..." autofocus="">
                </span>
        </form>
    </div>

    <div class="search-hover">
        <form id="demo-2">
            <input type="search" placeholder="搜索..." class="id_search">
        </form>
    </div>




    <div class="skin-part">
        <div id="tree-wrap">
            <div class="side-bar">
                <ul class="topnav menu-left-nest">
                    <li>
                        <a href="#" style="border-left:0px solid!important;" class="title-menu-left">

                            <span class="">facebow</span>
                            <i data-toggle="tooltip" class="entypo-cog pull-right config-wrap"></i>

                        </a>
                    </li>

                    <li>
                        <a class="tooltip-tip ajax-load" href="#" title="动态">
                            <i class="entypo-facebook"></i>
                            <span>动态圈</span>

                        </a>
                        <ul>
                            <li>
                                <a class="tooltip-tip2 ajax-load" href="index.html" title="新鲜动态"><i class="entypo-facebook-squared"></i><span>新鲜动态</span></a>
                            </li>
                            <li>
                                <a class="tooltip-tip2 ajax-load" href="index.html" title="我的动态"><i class="entypo-facebook-circled"></i><span>我的动态</span></a>
                            </li>
                        </ul>
                    </li>
                    <li>
                        <a class="tooltip-tip ajax-load" href="addFriends.html" title="有趣的人">
                            <i class="icon-user"></i>
                            <span>有趣的人</span>

                        </a>
                    </li>
                    <li>
                        <a class="tooltip-tip ajax-load" href="<?php echo url('gallery',['username'=>$username])?>" title="相册">
                            <i class="fontawesome-picture"></i>
                            <span>我的相册</span>

                        </a>
                    </li>

                    <li>
                        <a class="tooltip-tip ajax-load" href="#" title="博客">
                            <i class="entypo-facebook"></i>
                            <span>博客</span>

                        </a>
                        <ul>
                            <li>
                                <a class="tooltip-tip ajax-load" href="<?php echo url('bloglist')?>" title="我的博客">
                                    <i class="entypo-vkontakte"></i>
                                    <span>我的博客</span>

                                </a>
                            </li>
                            <li>
                                <a class="tooltip-tip2 ajax-load" href="<?php echo url('newblog')?>" title="新鲜博客"><i class="entypo-facebook-circled"></i><span>新鲜博客</span></a>
                            </li>
                        </ul>
                    </li>

                    <li>
                        <a class="tooltip-tip ajax-load" href="#" title="信箱">
                            <i class="icon icon-mail"></i>
                            <span>我的信箱</span>

                        </a>
                        <ul>
                            <li>
                                <a class="tooltip-tip2 ajax-load" href="mail.html" title="收件箱"><i class="entypo-mail"></i><span>收件箱</span></a>
                            </li>
                            <li>
                                <a class="tooltip-tip2 ajax-load" href="mail.html" title="垃圾箱"><i class="entypo-trash"></i><span>垃圾箱</span></a>
                            </li>
                        </ul>
                    </li>

                </ul>
                <div class="side-dash">
                    <h3>
                        <span>访问者</span>
                    </h3>
                    <div id="g1" style="height:180px" class="gauge"></div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- END OF SIDE MENU -->

<!--  PAPER WRAP -->
<div class="wrap-fluid">
    <div class="container-fluid paper-wrap bevel tlbr">

        <!-- CONTENT -->
        <!--TITLE -->
        <div class="row">
            <div id="paper-top">
                <div class="col-sm-3">
                    <h2 class="tittle-content-header">
                        <i class="icon icon-plus"></i>
                        <span>写博客
                            </span>
                    </h2>

                </div>

                <div class="col-sm-7">
                    <div class="devider-vertical visible-lg"></div>
                    <div class="tittle-middle-header">

                        <div class="alert">
                            <button type="button" class="close" data-dismiss="alert">×</button>
                            <span class="tittle-alert entypo-info-circled"></span>
                            欢迎回来,&nbsp;
                            <strong>Dave mattew!</strong>&nbsp;&nbsp;来看看有哪些新鲜事吧！
                        </div>

                    </div>
                </div>
                <div class="col-sm-2">
                    <div class="devider-vertical visible-lg"></div>
                    <div class="btn-group btn-wigdet pull-right visible-lg">
                        <div class="btn">
                            Widget</div>
                        <button data-toggle="dropdown" class="btn dropdown-toggle" type="button">
                            <span class="caret"></span>
                            <span class="sr-only">Toggle Dropdown</span>
                        </button>
                        <ul role="menu" class="dropdown-menu">
                            <li>
                                <a href="#">
                                    <span class="entypo-plus-circled margin-iconic"></span>Add New</a>
                            </li>
                            <li>
                                <a href="#">
                                    <span class="entypo-heart margin-iconic"></span>Favorite</a>
                            </li>
                            <li>
                                <a href="#">
                                    <span class="entypo-cog margin-iconic"></span>Setting</a>
                            </li>
                        </ul>
                    </div>


                </div>
            </div>
        </div>
        <!--/ TITLE -->

        <!-- BREADCRUMB -->
        <ul id="breadcrumb">
            <li>
                <span class="entypo-home"></span>
            </li>
            <li><i class="fa fa-lg fa-angle-right"></i>
            </li>
            <li><a href="#" title="Sample page 1">Home</a>
            </li>
            <li><i class="fa fa-lg fa-angle-right"></i>
            </li>
            <li><a href="#" title="Sample page 1">写博客</a>
            </li>
            <li class="pull-right">
                <div class="input-group input-widget">

                    <input style="border-radius:15px" type="text" placeholder="Search..." class="form-control">
                </div>
            </li>
        </ul>

        <!-- END OF BREADCRUMB -->

            <!-- /END OF CONTENT -->

            <!-- 表单区域 -->
            <form action="<?php echo url('add_blog')?>" method="post" class="form-horizontal bucket-form" enctype="multipart/form-data">
                <input type="hidden" value="<?php echo $username?>" name="uname">
                <div class="form-group">
                    <label class="col-sm-3 control-label">标题</label>
                    <div class="col-sm-6">
                        <input type="text" class="form-control" name="blogtitle">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">概要</label>
                    <div class="col-sm-6">
                        <input type="text" class="form-control" name="blogdetail">
                    </div>
                </div>
                <div class="social-wrap">
                    <!-- POSTING -->
                    <div class="subForm">
                        <div class="nest" id="DropZoneClose">
                            <div class="title-alt">
                                <div class="titleClose">
                                    <a class="gone closeDt">
                                        <span class="entypo-cancel"></span>
                                    </a>
                                </div>
                                <div class="titleToggle">
                                    <a class="nav-toggle-alt" href="#DropZone">
                                        <span class="entypo-up-open"></span>
                                    </a>
                                </div>
                            </div>
                            <div class="body-nest" id="DropZone">
                                    <textarea style="display: block;"  name="blogcontent" id="dt" cols="30" rows="10" placeholder="写点什么吧..."></textarea>
                                    <input type="file" name="blogsrc[]" multiple="multiple">
                                    <button class="dtsub" type="submit">发表</button>
                            </div>
                        </div>
                    </div>
            </form>
            <!-- 表单区域结束 -->

            <!-- /END OF CONTENT -->



            <!-- FOOTER -->
            <div class="footer-space"></div>
            <div id="footer">
                <div class="devider-footer-left"></div>
                <div class="time">
                    <p id="spanDate">
                    <p id="clock">
                </div>
                <div class="copyright">Make with Love
                    <span class="entypo-heart"></span>Collect from <a href="http://www.cssmoban.com/" title="FACEBOW" target="_blank">FACEBOW</a> All Rights Reserved</div>
                <div class="devider-footer"></div>

            </div>
            <!-- / END OF FOOTER -->


        </div>
    </div>
    <!--  END OF PAPER WRAP -->

    <!-- RIGHT SLIDER CONTENT -->
    <div class="sb-slidebar sb-right">

        <div class="right-wrapper">
            <div class="row">
                <h3>
                    <span><i class="entypo-chat"></i>&nbsp;&nbsp;CHAT</span>
                </h3>
                <div class="col-sm-12">
                    <span class="label label-warning label-chat">Online</span>
                    <ul class="chat">
                        <li>
                            <a href="#">
                                <span>
                                    <img alt="" class="img-chat img-circle" src="http://api.randomuser.me/portraits/thumb/men/20.jpg">
                                </span><b>Dave Junior</b>
                                <br><i>Last seen : 08:00 PM</i>
                            </a>
                        </li>
                        <li>
                            <a href="#">
                                <span>
                                    <img alt="" class="img-chat img-circle" src="http://api.randomuser.me/portraits/thumb/men/21.jpg">
                                </span><b>Kenneth Lucas</b>
                                <br><i>Last seen : 07:21 PM</i>
                            </a>
                        </li>
                        <li>
                            <a href="#">
                                <span>
                                    <img alt="" class="img-chat img-circle" src="http://api.randomuser.me/portraits/thumb/men/22.jpg">
                                </span><b>Heidi Perez</b>
                                <br><i>Last seen : 05:43 PM</i>
                            </a>
                        </li>


                    </ul>

                    <span class="label label-chat">Offline</span>
                    <ul class="chat">
                        <li>
                            <a href="#">
                                <span>
                                    <img alt="" class="img-chat img-offline img-circle" src="http://api.randomuser.me/portraits/thumb/men/23.jpg">
                                </span><b>Dave Junior</b>
                                <br><i>Last seen : 08:00 PM</i>
                            </a>
                        </li>
                        <li>
                            <a href="#">
                                <span>
                                    <img alt="" class="img-chat img-offline img-circle" src="http://api.randomuser.me/portraits/thumb/women/24.jpg">
                                </span><b>Kenneth Lucas</b>
                                <br><i>Last seen : 07:21 PM</i>
                            </a>
                        </li>
                        <li>
                            <a href="#">
                                <span>
                                    <img alt="" class="img-chat img-offline img-circle" src="http://api.randomuser.me/portraits/thumb/men/25.jpg">
                                </span><b>Heidi Perez</b>
                                <br><i>Last seen : 05:43 PM</i>
                            </a>
                        </li>
                        <li>
                            <a href="#">
                                <span>
                                    <img alt="" class="img-chat img-offline img-circle" src="http://api.randomuser.me/portraits/thumb/women/25.jpg">
                                </span><b>Kenneth Lucas</b>
                                <br><i>Last seen : 07:21 PM</i>
                            </a>
                        </li>
                        <li>
                            <a href="#">
                                <span>
                                    <img alt="" class="img-chat img-offline img-circle" src="http://api.randomuser.me/portraits/thumb/men/26.jpg">
                                </span><b>Heidi Perez</b>
                                <br><i>Last seen : 05:43 PM</i>
                            </a>
                        </li>

                    </ul>
                </div>
            </div>
        </div>
    </div>

    <!-- END OF RIGHT SLIDER CONTENT-->



    <!-- MAIN EFFECT -->
    <script type="text/javascript" src="assets/js/preloader.js"></script>
    <script type="text/javascript" src="assets/js/bootstrap.js"></script>
    <script type="text/javascript" src="assets/js/app.js"></script>
    <script type="text/javascript" src="assets/js/load.js"></script>
    <script type="text/javascript" src="assets/js/main.js"></script>
    <script src="http://code.jquery.com/jquery-migrate-1.2.1.min.js"></script>

    <script type="text/javascript" src="assets/js/upload/demos/js/demo.min.js"></script>
    <script type="text/javascript" src="assets/js/upload/src/dmuploader.min.js"></script>


    <script src="assets/js/dropZone/lib/dropzone.js"></script>

    <script src="assets/js/textEditor/parser_rules/advanced.js"></script>
    <script src="assets/js/textEditor/dist/wysihtml5-0.4.0pre.js"></script>


    <script src="assets/js/textEditor/sceditor/minified/jquery.sceditor.bbcode.min.js"></script>


    <script src="assets/js/textEditor/lib/js/wysihtml5-0.3.0.js"></script>


    <script src="assets/js/textEditor/src/bootstrap3-wysihtml5.js"></script>

    <script>
        $('.textarea').wysihtml5();
    </script>

    <script type="text/javascript">
        $(prettyPrint);
    </script>
    <script>
        // Source: http://www.backalleycoder.com/2011/03/20/link-tag-css-stylesheet-load-event/
        var loadCSS = function(url, callback) {
            var link = document.createElement('link');
            link.type = 'text/css';
            link.rel = 'stylesheet';
            link.href = url;
            link.id = 'theme-style';

            document.getElementsByTagName('head')[0].appendChild(link);

            var img = document.createElement('img');
            img.onerror = function() {
                if (callback) callback(link);
            }
            img.src = url;
        }

        $(document).ready(function() {
            var initEditor = function() {
                $(".sceditor").sceditor({
                    plugins: 'bbcode',
                    style: "assets/js/textEditor/sceditor/minified/square.min.css"
                });
            };

            initEditor();
        });
    </script>



    <script>
        var editor = new wysihtml5.Editor("textarea", {
            toolbar: "toolbar",
            stylesheets: "assets/js/textEditor/examples/css/stylesheet.css",
            parserRules: wysihtml5ParserRules
        });

        var log = document.getElementById("log");

        editor
            .on("load", function() {
                log.innerHTML += "<div>load</div>";
            })
            .on("focus", function() {
                log.innerHTML += "<div>focus</div>";
            })
            .on("blur", function() {
                log.innerHTML += "<div>blur</div>";
            })
            .on("change", function() {
                log.innerHTML += "<div>change</div>";
            })
            .on("paste", function() {
                log.innerHTML += "<div>paste</div>";
            })
            .on("newword:composer", function() {
                log.innerHTML += "<div>newword:composer</div>";
            })
            .on("undo:composer", function() {
                log.innerHTML += "<div>undo:composer</div>";
            })
            .on("redo:composer", function() {
                log.innerHTML += "<div>redo:composer</div>";
            });
    </script>
    <script type="text/javascript">
        $('#drag-and-drop-zone').dmUploader({
            url: '/assets/js/upload/demos/upload.php',   //写上传图片的php文件路径
            dataType: 'json',
            allowedTypes: 'image/*',
            /*extFilter: 'jpg;png;gif',*/
            onInit: function() {
                $.danidemo.addLog('#demo-debug', 'default', 'Plugin initialized correctly');
            },
            onBeforeUpload: function(id) {
                $.danidemo.addLog('#demo-debug', 'default', 'Starting the upload of #' + id);

                $.danidemo.updateFileStatus(id, 'default', 'Uploading...');
            },
            onNewFile: function(id, file) {
                $.danidemo.addFile('#demo-files', id, file);
            },
            onComplete: function() {
                $.danidemo.addLog('#demo-debug', 'default', 'All pending tranfers completed');
            },
            onUploadProgress: function(id, percent) {
                var percentStr = percent + '%';

                $.danidemo.updateFileProgress(id, percentStr);
            },
            onUploadSuccess: function(id, data) {
                $.danidemo.addLog('#demo-debug', 'success', 'Upload of file #' + id + ' completed');

                $.danidemo.addLog('#demo-debug', 'info', 'Server Response for file #' + id + ': ' + JSON.stringify(data));

                $.danidemo.updateFileStatus(id, 'success', 'Upload Complete');

                $.danidemo.updateFileProgress(id, '100%');
            },
            onUploadError: function(id, message) {
                $.danidemo.updateFileStatus(id, 'error', message);

                $.danidemo.addLog('#demo-debug', 'error', 'Failed to Upload file #' + id + ': ' + message);
            },
            onFileTypeError: function(file) {
                $.danidemo.addLog('#demo-debug', 'error', 'File /'' + file.name + '/' cannot be added: must be an image');
            },
            onFileSizeError: function(file) {
                $.danidemo.addLog('#demo-debug', 'error', 'File /'' + file.name + '/' cannot be added: size excess limit');
            },
            /*onFileExtError: function(file){
              $.danidemo.addLog('#demo-debug', 'error', 'File /'' + file.name + '/' has a Not Allowed Extension');
            },*/
            onFallbackMode: function(message) {
                $.danidemo.addLog('#demo-debug', 'info', 'Browser not supported(do something else here!): ' + message);
            }
        });
    </script>


    <script>
        Dropzone.options.myDropzone = {

            // Prevents Dropzone from uploading dropped files immediately
            autoProcessQueue: false,

            init: function() {
                var submitButton = document.querySelector("#submit-all")
                myDropzone = this; // closure

                submitButton.addEventListener("click", function() {
                    myDropzone.processQueue(); // Tell Dropzone to process all queued files.
                });

                // You might want to show the submit button only when
                // files are dropped here:
                this.on("addedfile", function() {
                    // Show submit button here and/or inform user to click it.
                });

            }
        };
    </script>


</body>

</html>
